load("@local_config_cuda//cuda:build_defs.bzl", "if_cuda")
load("//bazel:tachyon_cc.bzl", "tachyon_cuda_library", "tachyon_cuda_unittest")

package(default_visibility = ["//visibility:public"])

tachyon_cuda_library(
    name = "cub_helper",
    hdrs = ["cub_helper.h"],
    deps = ["//tachyon/device/gpu:gpu_memory"],
)

tachyon_cuda_library(
    name = "cuda_driver",
    srcs = if_cuda(["cuda_driver.cc"]),
    hdrs = ["cuda_driver.h"],
    deps = [
        "//tachyon/device/gpu:gpu_driver",
        "@com_google_absl//absl/container:node_hash_map",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/synchronization",
    ] + if_cuda([
        "@local_config_cuda//cuda:cuda_driver",
    ]),
)

tachyon_cuda_library(
    name = "cuda_memory",
    hdrs = ["cuda_memory.h"],
    deps = ["//tachyon/base:compiler_specific"] + if_cuda([
        "@local_config_cuda//cuda:cuda_headers",
    ]),
)

tachyon_cuda_unittest(
    name = "cuda_unittests",
    srcs = [
        "cuda_driver_unittest.cc",
    ],
    deps = [
        ":cuda_driver",
    ],
)
